require(["common", "jQuery", "coAjax", "queryString", "href", "hash_routie"], function(jSouper, $, coAjax, QueryString, href, hash_routie) {
	App.set("NUMBER_MAX_VALUE", Number.MAX_VALUE);

	function _init() {
		coAjax.get(appConfig.bus_lottery_list, {
			bus_id: appConfig.bus_id,
			with_award_content_detail: true
		}, function(result) {
			App.set("$Cache.lottery.list", result.result)
		});
	};
	_init();
	setInterval(function() {
		App.set("$Cache.now", +new Date);
	}, 1000)

	App.set("$Event.lottery.user_draw_lottery", function(e, vm) {
		coAjax.post(appConfig.user.lottery_draw + vm.get("_id"), {
			bus_id: appConfig.bus_id
		}, function(result) {
			console.log("中奖信息：", result.result);
			_init();
		});
	});
});